<template>
    <el-table :data="tableChild" v-loading="loadingChild" style="width: 100%">
        <el-table-column label="" width="49">
            
        </el-table-column>
        <el-table-column label="分类">
            <template scope="scope">
                <span>{{scope.row.sIncrementName | isNull}}</span>
            </template>
        </el-table-column>
        <el-table-column label="订单量（条）">
            <template scope="scope">
                <span>{{scope.row.totalNum | isNull}}</span>
            </template>
        </el-table-column>
        <el-table-column label="销售额（元）">
            <template scope="scope">
                <span>{{scope.row.totalMoney | isNull}}</span>
            </template>
        </el-table-column>
    </el-table>
</template>
<script>
    import { getClassStatistics } from 'api/serviceManage';
    import { mapGetters } from 'vuex';
    export default {
        props: {
            scope: Object,  // $index/row/store  你可以看scope 这个对象，这个页面有很多简化的 
            childData: Object
        },
        data() {
            return { 
                loadingChild: false,
                tableChild: []
            }
        },
        computed: {
            ...mapGetters([
                'schoolId'
            ])
        },
        mounted() {
            // scope.row 可以获取这个row的信息比如id什么的,
            // 异步获取数据 赋值给 resourceC 即可
            let fSchoolId = this.schoolId;
            let fClassId = this.scope.row.fClassId;
            let date = this.childData.date;
                   
            this.loadingChild = true;
            getClassStatistics(fSchoolId, fClassId, date).then(res => {
                this.loadingChild = false;
                this.tableChild = res.data.content;
            }).catch(() => {
                this.loadingChild = false;
            });
        }
    }

</script>


